package com.finace.money.common.util;

import com.finace.money.common.Constant;
import com.finace.money.data.bean.StatusListBean;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by zhangpeng on 2018/1/29.
 */

public class ACacheClearUtil {

    public static void clear(){
        ACache aCache = ACache.get(UIUtil.getContext());
        ArrayList<StatusListBean> choose = (ArrayList<StatusListBean>) aCache.getAsObject(Constant.CHOOSE_ALL);
        List<String> mProvinceList = (List<String>) aCache.getAsObject(Constant.ADDRESS_PROVINCE);
        List<List<String>> mCityList = (List<List<String>>) aCache.getAsObject(Constant.ADDRESS_CITY);
        List<List<List<String>>> mAreaList = (List<List<List<String>>>) aCache.getAsObject(Constant.ADDRESS_AREA);
        String first = aCache.getAsString(Constant.firstIn);
        String remeber = aCache.getAsString(Constant.remeber);
        String remeber_account = aCache.getAsString(Constant.remeber_account);
        aCache.clear();
        aCache.put(Constant.CHOOSE_ALL,choose);
        aCache.put(Constant.ADDRESS_PROVINCE, (Serializable) mProvinceList);
        aCache.put(Constant.ADDRESS_CITY, (Serializable) mCityList);
        aCache.put(Constant.ADDRESS_AREA, (Serializable) mAreaList);
        aCache.put(Constant.firstIn, first);
        aCache.put(Constant.remeber, remeber);
        aCache.put(Constant.remeber_account, remeber_account);
    }

    public static void loginOut(){
        ACache aCache = ACache.get(UIUtil.getContext());
        aCache.remove(Constant.account);
        aCache.remove(Constant.login);
    }
}
